<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSystemLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('system_logs', function (Blueprint $table) {
            $table->id()->comment('管理员操作记录表');
            $table->integer('admin_id')->index()->comment('管理员id');
            $table->string('admin_name',64)->comment('管理员姓名');
            $table->integer('merchant_id')->nullable()->comment('商户id');
            $table->string('path',128)->comment('链接');
            $table->string('action',64)->comment('行为');
            $table->string('method',255)->comment('访问类型');
            $table->string('ip',16)->comment('登录ip');
            $table->string('type',32)->comment('类型');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('system_logs');
    }
}
